package com.neusoft.yuejian12.yuejian_12.model;

import com.neusoft.yuejian12.yuejian_12.javabean.UserBean;
import com.neusoft.yuejian12.yuejian_12.service.UserService;

import retrofit2.Call;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

/**
 * Created by ZTY on 2017/9/26.
 */

public class UserModel {
    private Retrofit retrofit;
    public UserModel(){
        retrofit = new Retrofit.Builder()
        //http://10.0.2.2/yuejian14/API/User/getUserLogin/
      //  http://172.24.10.175/workout/api.php/login/

                .baseUrl("http://172.24.10.130:8080/foodService/")
                .addConverterFactory(GsonConverterFactory.create())
                .build();
    }
    public Call<UserBean> login(String str_uname, String str_upass){
        UserService userService = retrofit.create(UserService.class);
        return userService.getUserLogin(str_uname,str_upass);
    }

    public Call<UserBean> register(String str_unamer, String str_upass, String str_tel, String str_address) {
        UserService userService = retrofit.create(UserService.class);
       return userService.getUserRegister(str_unamer,str_upass,str_tel,str_address);
    }
}
